PATHMac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Window Manager >

Programming With the Mac OS 8.5 Window Manager


ZoomWindowIdeal

Zooms a window in accordance with human interface guidelines.

pascal OSStatus ZoomWindowIdeal (
                     WindowPtr window,
                     SInt16 partCode,
                     Point *ioIdealSize);
window
A value of type WindowPtr . Pass a pointer to the window to be zoomed.
partCode
A value specifying the direction of the zoom being requested. Your application passes in the relevant value (either the inZoomIn or the inZoomOut constant).
ioIdealSize
A pointer to a structure of type Point . When you specify inZoomIn in the partCode parameter, you pass a pointer to the Point structure, but do not fill the structure with data. On return, the Point structure contains the new height and width of the window's content region, and ZoomWindowIdeal restores the previous user state. When you specify inZoomOut in the partCode parameter, you pass the ideal height and width of the window's content region in the Point structure. On return, the Point structure contains the new height and width of the window's content region; ZoomWindowIdeal saves the user state of the window and zooms the window to its ideal size for the standard state.
function result
A result code. See Result Codes.
DISCUSSION

Applications should use the ZoomWindowIdeal function instead of the older function ZoomWindow . When your application calls ZoomWindowIdeal , it automatically conforms to the human interface guidelines for determining a window's standard state, as described in Window Zooming .

The ZoomWindowIdeal function calculates a window's ideal standard state and updates a window's ideal user state independently of the WStateData structure. Previously, the window definition function was responsible for updating the user state, but because it relies upon the WStateData structure, the window definition function is unaware of the ideal standard state and can no longer track the window's zoom state reliably.

While the Window Manager is reliably aware of the window's zoom state, it cannot record the current user state in the WStateData structure, because the window definition function can overwrite that data. Therefore, if your application uses ZoomWindowIdeal , the WStateData structure is superseded, and the result of the FindWindow function should be ignored when determining whether a particular user click of the zoom box is a request to zoom in or out. When you adopt ZoomWindowIdeal and your application receives a result of either inZoomIn or inZoomOut from FindWindow , your application must use the function IsWindowInStandardState and code such as that in Listing 2-9 in Zooming a Window Gracefully to determine the appropriate part code to pass in the partCode parameter.

VERSION NOTES

Available with Mac OS 8.5 and later.


© 1999 Apple Computer, Inc. – (Last Updated 18 March 99)